package ph.loong.deliveryman.ui.account

import android.os.Bundle
import android.text.TextUtils
import com.administrator.kotlindemo1.utils.showToast
import deliveryman.loong.ph.deliveryman.R
import kotlinx.android.synthetic.main.activity_forget_pwd.*
import ph.loong.deliveryman.base.BaseActivity

class ForgetPwdActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_forget_pwd)
        setTitle("忘记密码")

        initView()
    }

    private fun initView() {
        submit.setOnClickListener({ modifyPwd() })
    }

    private fun modifyPwd() {
        val pwd1 = edit_pwd1.text.toString()
        val pwd2 = edit_pwd2.text.toString()

        if (!pwd1.equals(pwd2)) {
            showToast("密码两次输入不一致")
            return
        } else if (TextUtils.isEmpty(pwd1) || TextUtils.isEmpty(pwd2)) {
            showToast("密码不能输入为空")
            return
        } else {
            showToast(pwd1)
            //todo  进行网络请求
        }
    }
}
